<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 字符串转换为数字类型
        var str = '123';
        console.log(parseInt(str));
        console.log(parseFloat(str));
        var str1 = '123.33';
        console.log(parseInt(str1));
        console.log(parseFloat(str1));
        console.log(parseInt(true));
        console.log(parseFloat(false));
        console.log(parseInt('我123'));
        console.log(parseInt('123我'));
        console.log(Number("123"));
    </script>
</head>
<body>
    
</body>
</html>